package data

import (
	"gorm.io/gorm"
	"time"
)

type Container interface {
	Create(db *gorm.DB) *gorm.DB
}

type PostgresUserInfo struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Email    string `json:"email" gorm:"unique"`
	Id       int64  `json:"id" gorm:"primaryKey"`
}

func (PostgresUserInfo) TableName() string {
	return "data.users"
}
func (p PostgresUserInfo) Create(dbconfig *gorm.DB) *gorm.DB {
	var result *gorm.DB
	result = dbconfig.Create(&p)
	return result
}

type VerifyStruct struct {
	Email       string    `json:"email"`
	Vertifycode string    `json:"vertifycode"`
	Time        time.Time `json:"time"`
}

func (VerifyStruct) TableName() string {
	return "data.verification"
}
func (V VerifyStruct) Create(dbconfig *gorm.DB) *gorm.DB {
	var result *gorm.DB
	result = dbconfig.Create(&V)
	return result
}
